@extends('Admin.Index.index')
@section('title')
    商品属性添加
@endsection
@section('content')
<div class="page-container">
    <form action="" method="post" class="form form-horizontal" id="form-user-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>商品类别：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box">
                    <select class="select" id="classify">
                        @foreach($data as $re)
                        <option value="{{$re->c_id}}">{{$re->c_name}}</option>
                            @endforeach
                    </select>
                </span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">
                <span class="c-red">*</span>
                商品属性名称：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" id="property_name">
            </div>
        </div>
        <div class="row cl">
            <div class="col-9 col-offset-2">
                <button class="btn btn-primary radius" id="goods_property_add" type="button" >提交</button>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">
    $(function(){
        $('#goods_property_add').click(function () {
           var classify_id = $('#classify').val();
           var property_name = $('#property_name').val();
           $.post('{{url('/property_add/')}}',{c_id:classify_id,p_name:property_name},function (e) {
               if(e.status)
               {
                   layer.msg('添加成功',{icon:6},function () {
                       window.location.reload();
                   });
               }else {
                    layer.msg(e.info,{icon:5});
               }
           })
        });
    });
</script>
@endsection